<template>
  <div>
      <h3>SubItem组件</h3>
      <p>已知库存数: {{count}} </p>
      <button @click="SubFn" >库存-1</button>
  </div>
</template>

<script>
import { mapState , mapMutations, mapActions } from 'vuex'
export default {
    computed: {
        ...mapState(['count'])
    },
    methods: {
         ...mapMutations(['subCount']),
         ...mapActions(['asyncSubCount']),
        SubFn(){
            // this.subCount(1)
            this.asyncSubCount(1)
        }
    }
}
</script>